package com.example.allshengmedical.util;

import android.util.Log;

/**
 * 
 * @author 1
 * 异常处理工具类
 * 
 */
public class ByExceptionUtil {
	
	/**
	 * 记录
	 * @param ex
	 */
	public static void log(Throwable ex){
		if(ex != null){
			ex.printStackTrace();
			if(ex.getLocalizedMessage() != null){
				Log.e("by_exception", ex.getLocalizedMessage());
			}
		}
	}
	
	/**
	 * 记录
	 * @param ex
	 */
	public static void log(Exception ex){
		if(ex != null){
			ex.printStackTrace();
			if(ex.getLocalizedMessage() != null)
				Log.e("by_exception", ex.getLocalizedMessage());
		}
	}
	
}
